<div class="modal-header">
  <button type="button" class="close" ng-click="closeDialog()" aria-hidden="true">&times;</button>
  <h4 class="modal-title" ng-bind="translate('ADF_WIDGET_ADD_HEADER')">Add new widget</h4>
</div>
<div class="modal-body">
  <!-- dashboard categories enabled -->
  <div ng-if="createCategories">
    <uib-accordion ng-init="categorized = createCategories(widgets)">
      <uib-accordion-group heading="{{category.name}}" ng-repeat="category in categorized | adfOrderByObjectKey: 'name'">
        <dl class="dl-horizontal">
          <dt ng-repeat-start="widget in category.widgets | adfOrderByObjectKey: 'key'">
            <button class="btn-wo-border" ng-click="addWidget(widget.key)">
              {{widget.title}}
            </button>
          </dt>
          <dd ng-repeat-end ng-if="widget.description">
            {{widget.description}}
          </dd>
        </dl>
      </uib-accordion-group>
    </uib-accordion>
  </div>
  <!-- dashboard categories disabled -->
  <div style="display: inline-block;" ng-if="!createCategories">
    <dl class="dl-horizontal">
      <dt ng-repeat-start="widget in widgets | adfOrderByObjectKey: 'key'">
        <button class="btn-wo-border" ng-click="addWidget(widget.key)">
          {{widget.title}}
        </button>
      </dt>
      <dd ng-repeat-end ng-if="widget.description">
        {{widget.description}}
      </dd>
    </dl>
  </div>
</div>
<div class="modal-footer">
  <button type="button" class="btn btn-primary" ng-click="closeDialog()" ng-bind="translate('ADF_COMMON_CLOSE')">Close</button>
</div>
